package com.oschina.bottle.mysql;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 数据库属性
 *
 * @author <a href="mailto:zhongchao@gegejia.com">zhong</a>
 * @version 1.0 2016/11/19
 * @since 1.0
 */
@ConfigurationProperties(prefix = "mysql.jdbc")
public class DataSourceProperties
{
    /**
     * 数据库ip
     */
    private String host;

    /**
     * 端口号
     */
    private int port;

    /**
     * 数据库实例
     */
    private String name;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * mapper路径
     */
    private String mapperPackage;

    protected int maxActive = 20;
    protected int minIdle = 2;
    protected int maxWait = 10 * 1000;
    protected int validationInterval = 30000;
    protected int validationQueryTimeout = 5;
    protected int timeBetweenEvictionRunsMillis = 60 * 1000;
    protected int minEvictableIdleTimeMillis = 300000;
    protected int initialSize = 1;
    protected int removeAbandonedTimeout = 60;

    public String getHost()
    {
        return host;
    }

    public void setHost(String host)
    {
        this.host = host;
    }

    public int getPort()
    {
        return port;
    }

    public void setPort(int port)
    {
        this.port = port;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getUsername()
    {
        return username;
    }

    public void setUsername(String username)
    {
        this.username = username;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public int getMaxActive()
    {
        return maxActive;
    }

    public void setMaxActive(int maxActive)
    {
        this.maxActive = maxActive;
    }

    public int getMinIdle()
    {
        return minIdle;
    }

    public void setMinIdle(int minIdle)
    {
        this.minIdle = minIdle;
    }

    public int getMaxWait()
    {
        return maxWait;
    }

    public void setMaxWait(int maxWait)
    {
        this.maxWait = maxWait;
    }

    public int getValidationInterval()
    {
        return validationInterval;
    }

    public void setValidationInterval(int validationInterval)
    {
        this.validationInterval = validationInterval;
    }

    public int getValidationQueryTimeout()
    {
        return validationQueryTimeout;
    }

    public void setValidationQueryTimeout(int validationQueryTimeout)
    {
        this.validationQueryTimeout = validationQueryTimeout;
    }

    public int getTimeBetweenEvictionRunsMillis()
    {
        return timeBetweenEvictionRunsMillis;
    }

    public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis)
    {
        this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
    }

    public int getMinEvictableIdleTimeMillis()
    {
        return minEvictableIdleTimeMillis;
    }

    public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis)
    {
        this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
    }

    public int getInitialSize()
    {
        return initialSize;
    }

    public void setInitialSize(int initialSize)
    {
        this.initialSize = initialSize;
    }

    public int getRemoveAbandonedTimeout()
    {
        return removeAbandonedTimeout;
    }

    public void setRemoveAbandonedTimeout(int removeAbandonedTimeout)
    {
        this.removeAbandonedTimeout = removeAbandonedTimeout;
    }

    public String getMapperPackage() {
        return mapperPackage;
    }

    public void setMapperPackage(String mapperPackage) {
        this.mapperPackage = mapperPackage;
    }
}
